<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 在连接中调用 -->
    <a href="javascript:fn()">1111</a>
    <script>
        function fn() {
            console.log(111);
        }
    </script>
    <script>
        //在函数中调用 递归和回调
        //递归
        function fun(a) {
            if (a <= 1) {
                return 1;
            }
            return (a * fun(a - 1));
        }
        console.log(fun(5));//120
        console.log('-------');

        //回调
        function callback() {
            console.log('我是回调函数');
        }
        function fun1(a, b) {
            console.log(a);
            b();
        }
        fun1(2, callback);
    </script>

</body>

</html>